package com.shen.driver;

/**
 * Author:shen
 * CreateDate:2020/5/11.
 * Function:
 */
public class Person {
    public void driving(Object object){
        if(object instanceof Car){
            System.out.println("驾驶员驾驶汽车");
            ((Car) object).start();
            ((Car) object).stop();
        }else if(object instanceof Plane){
            System.out.println("驾驶员驾驶飞机");
           ((Plane) object).start();
           ((Plane) object).stop();
        }else if(object instanceof Tanks){
            System.out.println("驾驶员驾驶坦克");
            ((Tanks) object).start();
            ((Tanks) object).climbing();
        }else if(object instanceof Tractor){
            System.out.println("驾驶员驾拖拉机");
            ((Tractor) object).start();
            ((Tractor) object).climbing();
        }else if (object instanceof Ship){
            System.out.println("驾驶员驾拖船");
            ((Ship) object).start();
            ((Ship) object).honking();
            ((Ship) object).anchor();
        }
    }
}
